package com.example.xm.adapter.HomeAdapter;

import android.content.Context;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.example.xm.R;
import com.example.xm.base.BaseAdapter;
import com.example.xm.bean.HomeBean.HomeYouHomeSocietyBean;

import java.util.List;

public class YouHomeSocietyAdapter extends BaseAdapter {
    public YouHomeSocietyAdapter(Context context, List data) {
        super(context, data);
    }

    @Override
    protected int getLayout() {
        return R.layout.fragment_youhome_society_item;
    }

    @Override
    protected void bindData(BaseViewHolder viewHolder, Object o) {
        ImageView img = (ImageView) viewHolder.getViewById(R.id.iv_head_society);
        TextView name = (TextView) viewHolder.getViewById(R.id.tv_name_society);
        TextView chengyuan = (TextView) viewHolder.getViewById(R.id.tv_chenyuan);
        TextView huodong = (TextView) viewHolder.getViewById(R.id.tv_huodong);
        TextView title = (TextView) viewHolder.getViewById(R.id.tv_title_society);
        HomeYouHomeSocietyBean.DataBean bean = (HomeYouHomeSocietyBean.DataBean) o;
        name.setText(bean.getFullName());
        Glide.with(context).load(bean.getLogo()).into(img);
        chengyuan.setText("成员：" + bean.getCountUser());
        huodong.setText("活动：" + bean.getCountActivity());
        title.setText(bean.getNote());
    }
}
